]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
[ShellAppSystem] Don't crash if the menu system is empty
authorColin Walters <walters@verbum.org>
Thu, 20 May 2010 21:06:30 +0000 (17:06 -0400)
committerColin Walters <walters@verbum.org>
Thu, 20 May 2010 21:06:30 +0000 (17:06 -0400)
This is a bit pathological, but if your menu tree is empty, we
shouldn't crash.

src/shell-app-system.c

index ad8cef47deca0d3af07cd41ee929dfc261e82dbd..faa960e551580faee5b8c5165a6a587d3e570484 100644 (file)
@@ -309,9 +309,15 @@ reread_entries (ShellAppSystem     *self,
   g_slist_free (*cache);
   *cache = NULL;
 
-  *cache = gather_entries_recurse (self, *cache, unique, trunk);
-
-  gmenu_tree_item_unref (trunk);
+  if (!trunk)
+    {
+      *cache = NULL;
+    }
+  else
+    {
+      *cache = gather_entries_recurse (self, *cache, unique, trunk);
+      gmenu_tree_item_unref (trunk);
+    }
 }
 
 static void